package com.health.listener;

import com.health.pojo.Product;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class Listener1 {

    @RabbitListener(queuesToDeclare = @Queue("简单队列1"))
    public void show1(String msg){
        System.out.println("简单模式，消费者接受消息："+msg);
    }

    @RabbitListener(queuesToDeclare = @Queue("简单队列2"))
    public void show2(Product product){
        System.out.println("简单模式，消费者接受大包裹"+product);
    }

}
